<?php

class Default_Model_Table_Contact extends Zend_Db_Table_Abstract
{
    protected $_name = 'contact_content';
    
    public function getGoogleLink()
    {
        $select = $this->select();
        $select->order('id DESC')
               ->where('type=?', 'google_link')
               ->limit('1');
        $GoogleLink = $this->_db->query($select)->fetchAll();
        return $GoogleLink[0]['link'];
    }

        public function getAdress()
    {
        $select = $this->select();
        $select->order('id ASC')
               ->where('type=?', 'adress')
               ->limit('10');
        $Data = $this->_db->query($select)->fetchAll();
        return $Data;
    }

        public function getPhone()
    {
        $select = $this->select();
        $select->order('id ASC')
               ->where('type=?', 'phone')
               ->limit('10');
        $Data = $this->_db->query($select)->fetchAll();
        return $Data;
    }

        public function getUrls()
    {
        $select = $this->select();
        $select->order('id ASC')
               ->where('type=?', 'link')
               ->limit('10');
        $Data = $this->_db->query($select)->fetchAll();
        return $Data;
    }

            public function getAdressLimit($limit)
    {
        $select = $this->select();
        $select->order('id ASC')
               ->where('type=?', 'adress')
               ->limit($limit);
        $Data = $this->_db->query($select)->fetchAll();
        return $Data;
    }

        public function getPhoneLimit($limit)
    {
        $select = $this->select();
        $select->order('id ASC')
               ->where('type=?', 'phone')
               ->limit($limit);
        $Data = $this->_db->query($select)->fetchAll();
        return $Data;
    }

        public function getUrlsLimit($limit)
    {
        $select = $this->select();
        $select->order('id ASC')
               ->where('type=?', 'link')
               ->limit($limit);
        $Data = $this->_db->query($select)->fetchAll();
        return $Data;
    }

}

